<template>
	<view>
		<view class="account_top">
			<view class="con">
				<view class="top">
					<view class="left">
						<view class="span">
							<text>钱包余额（元）</text>
							<!-- <image src="../../static/images/a_i2.png" mode="widthFix"></image> -->
						</view>
						<view class="b">{{info.balance}}</view>
					</view>
					<navigator url="/pages/center/out" hover-class="none">
						<view class="right">
							<text>去提现</text>
						</view>
					</navigator>
				</view>
			</view>
		</view>
		<view class="wp">
			<view class="shu_title">
				<view class="span"></view>
				<text>收支明细</text>
			</view>
			<view class="integral_list">
				<!-- <navigator url="/pages/center/moenyinfo" hover-class="none"> -->
				<div class="item" v-for="(item,i) in list.items" :key="i">
					<div class="txt">
						<div class="span">存入20000到期本金及收益</div>
						<div class="em">2024-05-10 19:30</div>
					</div>
					<div class="b">+20000</div>
				</div>
				
				
				<view class="web_404" v-if="list.items.length==0">
					<image src="../../static/images/none404.png" mode="widthFix"></image>
				</view>
				
				<!-- </navigator> -->
				<!-- <navigator url="/pages/center/moenyinfo" hover-class="none">
				<div class="item">
					<div class="txt">
						<div class="span">提现（扣除手续费3%）</div>
						<div class="em">2024-05-10 19:30</div>
					</div>
					<div class="b">-20000</div>
				</div>
			</navigator> -->
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				info: [],
				list: []
			}
		},
		onLoad() {
			let that = this;
			if (that.common.GetStorage('byh5token')) {
				that.logintype = that.common.GetStorage('byh5type');

				that.GetUserMass();
			} else {
				uni.reLaunch({
					url: '/pages/login/login',
				})
			}
		},
		methods: {
			GetUserMass: function() {
				let that = this;
				uni.showLoading({
					title: '加载中...',
					mask: true
				});
				that.common.http('GET', 'user', '', function(res) {
					uni.hideLoading();
					console.log(res.data)
					that.info = res.data;
					that.GetUserBank();
				});
			},

			GetUserBank() {
				let that = this;
				uni.showLoading({
					title: '加载中...',
					mask: true
				});
				that.common.http('GET', 'user/balance', '', function(res) {
					uni.hideLoading();
					console.log(res.data);
					that.list = res.data;
				});
			},
		}
	}
</script>

<style scoped>
	.wp {
		margin-top: 30rpx;
	}

	.account_top {
		background-color: #c9e7ff;
		padding: 0 18rpx;
	}

	.account_top .con {
		background-color: #2884ff;
		background: linear-gradient(to right, #4292ff, #4292ff);
		background-repeat: no-repeat;
		background-position: center;
		border-top-left-radius: 12px;
		border-top-right-radius: 12px;
		background-size: cover;
	}

	.account_top .con .top {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 80rpx 32rpx;
	}

	.account_top .con .top .left .span {
		font-size: 24rpx;
		color: #fff;
	}

	.account_top .con .top .left .b {
		font-size: 48rpx;
		color: #fff;
		font-weight: bold;
		margin-top: 20rpx;
	}

	.account_top .con .top .left image {
		width: 36rpx;
		vertical-align: middle;
	}

	.account_top .con .top .right {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 184rpx;
		height: 66rpx;
		border-radius: 50px;
		background-color: #fff;
		font-size: 28rpx;
		color: #4292ff;
	}

	.account_top .con .top .right text {
		vertical-align: middle;
		margin-left: 12rpx;
		line-height: 1;
	}

	.account_top .con .top .right image {
		width: 24rpx;
		vertical-align: middle;
	}
</style>